import 'package:json_annotation/json_annotation.dart';
part 'remark_item.g.dart';

@JsonSerializable()
class RemarkItem {
  String id; // 评论ID
  int comment_count; // 评论数
  String content; // 评论内容
  String created_at; // 发布时间, 时间戳
  int like_count; // 点赞数
  String pic; // 用户头像快照
  int target_type; // 评论对象类型 1-文章 2-评论 3-快讯
  String user_name; // 用户名称快照
  List<RemarkItem> sub_comment = []; // 子评论列表
  List<String> images = []; // 图片信息
  List<String> videos = []; // 视频地址信息
  String target_user_name;
  int like_status; //0-点赞 1-未点赞
  RemarkItem(
      {required this.id,
      required this.content,
      required this.comment_count,
      required this.created_at,
      required this.like_count,
      required this.pic,
      required this.target_type,
      required this.user_name,
      required this.sub_comment,
      required this.videos,
      required this.images,
      required this.target_user_name,
      required this.like_status});
  factory RemarkItem.fromJson(Map<String, dynamic> json) =>
      _$RemarkItemFromJson(json);

  Map<String, dynamic> toJson() => _$RemarkItemToJson(this);
}
